/*
 * DIM-SUM操作系统 - 同步异常处理
 *
 * Copyright (C) 2023 国科础石(重庆)软件有限公司
 *
 * 作者: Dong Peng <w-pengdong@kernelsoft.com>
 *
 * License terms: GNU General Public License (GPL) version 3
 *
 */

#ifndef __ASM_ELX_SYNC_H
#define __ASM_ELX_SYNC_H
#include <asm/exception.h>

typedef long (*handle_ec)(struct exception_spot *s, u64 fault_addr, u32 esr);
typedef long (*syscall_ec)(struct exception_spot *s, long nr);
asmlinkage void handle_mem_fault(struct exception_spot *regs);
asmlinkage void handle_unknown_fault(struct exception_spot *regs);
asmlinkage void handle_insn_misaligned_fault(struct exception_spot *regs);
asmlinkage void handle_insn_fault(struct exception_spot *regs);
asmlinkage void handle_insn_illegal_fault(struct exception_spot *regs);
asmlinkage void handle_load_misaligned_fault(struct exception_spot *regs);
asmlinkage void handle_load_fault(struct exception_spot *regs);
asmlinkage void handle_store_misaligned_fault(struct exception_spot *regs);
asmlinkage void handle_store_fault(struct exception_spot *regs);
asmlinkage void handle_ecall_u_fault(struct exception_spot *regs);
asmlinkage void handle_ecall_s_fault(struct exception_spot *regs);
asmlinkage void handle_ecall_m_fault(struct exception_spot *regs);
asmlinkage void handle_break_fault(struct exception_spot *regs);
extern void (*handle_arch_irq)(struct exception_spot *);
asmlinkage void handle_irq_fault(struct exception_spot *regs);
asmlinkage void handle_notify_resume(struct exception_spot *regs,
	unsigned long thread_info_flags);
asmlinkage void handle_excp_dbg(struct exception_spot *regs);
void handle_syscall_trace_enter(struct exception_spot *regs);
void handle_syscall_trace_exit(struct exception_spot *regs);
#endif
